package com.jxb.bit;

/**
 * 类注释
 *
 * @author jiaobo
 * @date Created in 2024/12/24 22:30
 **/
public class HammingDistance_461 {

    public static void main(String[] args) {

    }

    public int hammingDistance(int x, int y) {
        int distance = 0;
        for (int xor = x^y;xor != 0;xor &= (xor-1)) {
            distance++;
        }
        return distance;
    }

}
